using System;
using System.Collections.Generic;
using System.Configuration;
using System.Text;
using ALinq.BBS.Common.Config;

namespace ALinq.BBS.Common.Config
{
    public class PlugElementCollection : ConfigurationElementCollection<PlugElement>
    {
        protected override ConfigurationElement CreateNewElement()
        {
            return new PlugElement();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((PlugElement)element).Name;
        }
    }

    public class PlugElement : ConfigurationElement
    {
        [ConfigurationProperty("name")]
        public string Name
        {
            get { return (string) base["name"]; }
            set { base["name"] = value; }
        }

        [ConfigurationProperty("assembly")]
        public string Assembly
        {
            get { return (string) base["assembly"]; }
        }

        [ConfigurationProperty("enable")]
        public bool Enable
        {
            get { return (bool) base["enable"]; }
        }
    }
}